Null Space (Kernel)

Introduction

The null space (also called the kernel) of a matrix is the collection of all vectors that a linear transformation sends to the zero vector. If a matrix represents a transformation that “squashes” certain directions, the null space tells us exactly which directions disappear.

This article assumes you already know what a linear transformation is and how matrices act on vectors.

What the Null Space Represents

Why Null Spaces Matter

How to Compute a Null Space

To find all vectors $x$ such that $Ax = 0$:

  1. Write the augmented matrix for the system $Ax = 0$.
  2. Row‑reduce the matrix to reduced row‑echelon form (RREF).
  3. Identify pivot and free variables.
  4. Express the solution in terms of the free variables.
  5. Write the null space as all linear combinations of the resulting basis vectors.

A Simple Example

Consider the matrix $$A=\begin{pmatrix} 1 & 2 & -1 \\ 2 & 5 & 1 \\ -1 & -3 & 0 \end{pmatrix}.$$ We want all vectors $x$ such that $Ax=0$.

1. Form the system

Let $x=(x_1,x_2,x_3)$. Then

2. Row‑reduce the matrix

Start with the augmented matrix for $Ax=0$: $$\begin{pmatrix} 1 & 2 & -1 & 0 \\ 2 & 5 & 1 & 0 \\ -1 & -3 & 0 & 0 \end{pmatrix}.$$ Row‑reduce: $$\to \begin{pmatrix} 1 & 2 & -1 & 0 \\ 0 & 1 & 3 & 0 \\ 0 & -1 & -1 & 0 \end{pmatrix} \to \begin{pmatrix} 1 & 2 & -1 & 0 \\ 0 & 1 & 3 & 0 \\ 0 & 0 & 2 & 0 \end{pmatrix} \to \begin{pmatrix} 1 & 2 & -1 & 0 \\ 0 & 1 & 3 & 0 \\ 0 & 0 & 1 & 0 \end{pmatrix}.$$

3. Identify pivot and free variables

This means the only solution is the trivial one.

4. Solve the system

From the final matrix:

5. Describe the null space

All variables are forced to zero, so $$\text{Null}(A)=\{(0,0,0)\}.$$ A contrasting example works best when the null space is genuinely non‑trivial, so the reader sees free variables appear and a whole family of solutions emerge. This one mirrors the structure of the previous example but produces a one‑dimensional null space instead of a trivial one.

An example with a non‑trivial null space

Consider the matrix $$A=\begin{pmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \\ 1 & 1 & 2 \end{pmatrix}.$$ We want all vectors $x=(x_1,x_2,x_3)$ such that $Ax=0$.

1. Form the system

The matrix corresponds to:

2. Row‑reduce the augmented matrix

Start with: $$\begin{pmatrix} 1 & 2 & 3 & 0 \\ 2 & 4 & 6 & 0 \\ 1 & 1 & 2 & 0 \end{pmatrix}.$$ Row‑reduce: $$\to \begin{pmatrix} 1 & 2 & 3 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & -1 & -1 & 0 \end{pmatrix} \to \begin{pmatrix} 1 & 2 & 3 & 0 \\ 0 & 1 & 1 & 0 \\ 0 & 0 & 0 & 0 \end{pmatrix}.$$

3. Identify pivot and free variables

Let $x_3 = t$.

4. Solve the system

From the second row:

From the first row:

5. Describe the null space

All solutions have the form: $$x = (-t,\,-t,\,t).$$ Factor out $t$: $$\text{Null}(A)=\{\, t(-1,-1,1) : t\in\mathbb{R} \,\}.$$ This null space is a line through the origin. It shows that the matrix collapses all vectors along the direction $(-1,-1,1)$ to zero, while acting non‑trivially on directions perpendicular to it.

Interpreting the Geometry

Common Patterns

Calculator

Finding the null space

  • To calculate the null space for a matrix, you can use the $\operatorname{nullSpace}()$ function:
nullSpace([1, 2, 1; 0, 0, 0]) nullSpace([1, 2, 3; 2, 4, 6; 1, 1, 2])

Exercises

  1. Find the null space of $$A = \begin{pmatrix} 1 & -1 \\ 2 & -2 \end{pmatrix}.$$

    Solution

    Row‑reduce: $$\begin{pmatrix} 1 & -1 \\ 2 & -2 \end{pmatrix} \to \begin{pmatrix} 1 & -1 \\ 0 & 0 \end{pmatrix}.$$ Equation: $x_1 - x_2 = 0 \Rightarrow x_1 = x_2$.

    Null space: $$\{\, t(1,1) : t \in \mathbb{R} \,\}.$$

  2. Determine all vectors $x$ such that $$\begin{pmatrix} 3 & 0 & 6 \\ 1 & 0 & 2 \end{pmatrix} x = 0.$$

    Solution

    Row‑reduce: $$\begin{pmatrix} 3 & 0 & 6 \\ 1 & 0 & 2 \end{pmatrix} \to \begin{pmatrix} 1 & 0 & 2 \\ 0 & 0 & 0 \end{pmatrix}.$$ Equation: $x_1 + 2x_3 = 0$.

    Let $x_2 = s$, $x_3 = t$: $$x = (-2t,\, s,\, t).$$

  3. True or false: If the null space of a matrix contains a non‑zero vector, then its columns are linearly dependent.

    Solution

    True. A non‑zero vector in the null space means a non‑trivial linear combination of columns equals zero.

  4. Compute the null space of $$A = \begin{pmatrix} 1 & 2 & 1 \\ 0 & 0 & 0 \end{pmatrix}.$$

    Solution

    Equation: $x_1 + 2x_2 + x_3 = 0$.

    Let $x_2 = s$, $x_3 = t$: $$x = (-2s - t,\, s,\, t).$$

  5. Describe in words the geometric meaning of a 2×3 matrix having a 1‑dimensional null space.

    Solution

    A 1‑dimensional null space means exactly one direction in $\mathbb{R}^3$ is flattened to zero when mapping into $\mathbb{R}^2$.

  6. Solve for the null space of $$A = \begin{pmatrix} 2 & 4 \\ 1 & 2 \\ 3 & 6 \end{pmatrix}.$$

    Solution

    All rows are multiples of $(1,2)$, so the system reduces to: $$x_1 + 2x_2 = 0.$$ Let $x_2 = t$: $$x = (-2t,\, t).$$

  7. Let $$A = \begin{pmatrix} 1 & 0 & -1 \\ 0 & 1 & 1 \end{pmatrix}.$$ Find all $x$ such that $Ax = 0$.

    Solution

    Solve:

    • $x_1 - x_3 = 0 \Rightarrow x_1 = x_3$
    • $x_2 + x_3 = 0 \Rightarrow x_2 = -x_3$

    Let $x_3 = t$: $$x = (t,\,-t,\, t).$$